home *** CD-ROM | disk | FTP | other *** search
- /* ------------------------------------------
- wrap icon.c
-
- THINK C "Set Project Type..." settings:
- code resource, type 'OAPd', ID 1000,
- custom header, preloaded and locked,
- file type 'rsrc', file creator 'RSED'.
- ------------------------------------------
- */
- #include "defs.h"
-
- void main( WindowPeek the_window );
-
- void main( WindowPeek the_window )
- {
- BitMap icon_map;
- long bits[4];
- Rect dest;
- GrafPtr wmgr_port;
- Boolean **wrapping;
-
- if (!the_window->visible || !the_window->hilited
- || !the_window->goAwayFlag)
- return;
-
- wrapping = (Boolean **)GetResource('OAP1', 128);
- if (wrapping != NIL)
- {
- icon_map.rowBytes = 2;
- icon_map.baseAddr = (Ptr) &bits;
- icon_map.bounds.top = icon_map.bounds.left
- = 0;
- icon_map.bounds.right
- = icon_map.bounds.bottom
- = 8;
- if (**wrapping)
- {
- bits[0] = 0x00000000L;
- bits[1] = 0xFC000400L;
- bits[2] = 0x04001500L;
- bits[3] = 0x0E000400L;
- }
- else // not wrapping
- {
- bits[0] = 0x04000200L;
- bits[1] = 0xFF000200L;
- bits[2] = 0x04000000L;
- bits[3] = 0x00000000L;
- }
- dest = (**(the_window->strucRgn)).rgnBBox;
- dest.left += 22;
- dest.top += 6;
- dest.right = dest.left + 8;
- dest.bottom = dest.top + 8;
- GetPort( &wmgr_port );
- CopyBits( &icon_map, &wmgr_port->portBits,
- &icon_map.bounds, &dest, srcCopy, NIL );
- }
- }
-